{switch name="type" }
{case value="title"}
<div class="layui-form-item">
    <label class="layui-form-label">标题图片</label>
    <div class="layui-input-inline">
        <input type="radio" name="setup[thumb]" {if isset($setup.thumb) && $setup.thumb eq 1}checked{/if} value="1" title="是">
        <input type="radio" name="setup[thumb]" {if isset($setup.thumb) && $setup.thumb eq 0}checked{/if} value="0" title="否">
    </div>
</div>
<div class="layui-form-item">
    <label class="layui-form-label">标题样式</label>
    <div class="layui-input-inline">
        <input type="radio" name="setup[style]" value="1" {if isset($setup.style) && $setup.style eq 1}checked{/if} title="是">
        <input type="radio" name="setup[style]" value="0" {if isset($setup.style) && $setup.style eq 0}checked{/if} title=" 否">
    </div>
</div>
{/case}

{case value="text" }
<div class="layui-form-item">
    <div class="layui-inline">
        <label class="layui-form-label">默认值</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input input-text" size="50"  name="setup[default]" value="{:isset($setup.default)?$setup.default:''}" />
        </div>
    </div>
    <div class="layui-inline">
        <label class="layui-form-label">是否为密码框</label>
        <div class="layui-input-inline">
            <input type="radio" name="setup[ispassword]" {if isset($setup.ispassword) && $setup.ispassword == 1}checked{/if} value="1" title="是">
            <input type="radio" name="setup[ispassword]" {if isset($setup.ispassword) && $setup.ispassword == 0}checked{/if} value="0" title="否">
        </div>
    </div>
</div>
<input type="hidden" id="varchar" name="setup[fieldtype]" value="varchar"/>
{/case}

{case value="textarea" }
<div class="layui-form-item">
    <label class="layui-form-label">字段类型</label>
    <div class="layui-input-inline">
        <select name="setup[fieldtype]">
            <option value="mediumtext" {if isset($setup.fieldtype) && $setup.fieldtype eq 'mediumtext'}selected{/if} >MEDIUMTEXT</option>
            <option value="text" {if isset($setup.fieldtype) && $setup.fieldtype eq 'text'}selected{/if}>TEXT</option>
        </select>
    </div>
</div>
<div class="layui-form-item">
    <label class="layui-form-label">默认值</label>
    <div class="layui-input-block">
        <textarea  name="setup[default]" class="layui-textarea">{:isset($setup.default)?$setup.default:''}</textarea>
    </div>
</div>
{/case}

{case value="select" }
<div class="layui-form-item">
    <label class="layui-form-label">选项列表</label>
    <div class="layui-col-lg4">
        <textarea  name="setup[options]" class="layui-textarea">{:isset($setup.options)?$setup.options:''}</textarea>
    </div>
    <div class="layui-form-mid layui-word-aux">例：选项名称|值</div>
</div>
<div class="layui-form-item">
    <label class="layui-form-label">选项类型</label>
    <div class="layui-input-inline">
        <input type="radio" name="setup[multiple]" value="0" {if isset($setup.multiple) && $setup.multiple eq 0}checked{/if} title="下拉框">
        <input type="radio" name="setup[multiple]" value="1" {if isset($setup.multiple) && $setup.multiple eq 1}checked{/if} title="多选列表框">
    </div>
</div>
<div class="layui-form-item">
    <label class="layui-form-label">字段类型</label>
    <div class="layui-input-inline">
        <select name="setup[fieldtype]" onchange="javascript:numbertype(this.value);">
            <option value="varchar" {if isset($setup.fieldtype) && $setup.fieldtype eq 'varchar'}selected{/if} >字符 VARCHAR</option>
            <option value="tinyint" {if isset($setup.fieldtype) && $setup.fieldtype eq 'tinyint'}selected{/if}>整数 TINYINT(3)</option>
            <option value="smallint" {if isset($setup.fieldtype) && $setup.fieldtype eq 'smallint'}selected{/if}>整数 SMALLINT(5)</option>
            <option value="mediumint" {if isset($setup.fieldtype) && $setup.fieldtype eq 'mediumint'}selected{/if}>整数 MEDIUMINT(8)</option>
            <option value="int" {if isset($setup.fieldtype) && $setup.fieldtype eq 'int'}selected{/if}>整数 INT(10)</option>
        </select>
        <span id="numbertype" style="display:none;"  >
            <input type="checkbox" name = "setup[numbertype]" value="1" {if isset($setup.numbertype) && $setup.numbertype eq 1}checked{/if} />不包括负数
       </span>
    </div>
</div>
<div class="layui-form-item">
    <label class="layui-form-label">可见选项的数目</label>
    <div class="layui-input-inline">
        <input type="text" class="input-text layui-input" size="5" name="setup[size]" value="{:isset($setup.size)?$setup.size:''}" />
    </div>
</div>
<div class="layui-form-item">
    <label class="layui-form-label">默认值</label>
    <div class="layui-input-inline">
        <input type="text" class="input-text layui-input" size="5"  name="setup[default]" value="{:isset($setup.default)?$setup.default:''}" />
    </div>
</div>
{/case}

{case value="editor"}
<div class="layui-form-item">
    <label class="layui-form-label">编辑器类型</label>
    <div class="layui-input-inline">
        <select name="setup[edittype]">
            <option value="wangEditor" {if isset($setup.edittype) &&  $setup.edittype eq 'wangEditor'}selected{/if}>wangEditor</option>
            <option value="nkeditor" {if isset($setup.edittype) && $setup.edittype eq 'nkeditor'}selected{/if}>nkeditor</option>
            <option value="ueditor" {if isset($setup.edittype) && $setup.edittype eq 'ueditor'}selected{/if}>UEditor</option>
        </select>
    </div>
</div>
{/case}

{case value="datetime"}

{/case}

{case value="groupid"}
<div class="layui-form-item">
    <label class="layui-form-label">选项类型</label>
    <div class="layui-input-inline">
        <input type="radio" name="setup[inputtype]" value="checkbox" {if isset($setup.inputtype) && $setup.inputtype eq 'checkbox'}checked{/if} title="复选框">
        <input type="radio" name="setup[inputtype]" value="select" {if isset($setup.inputtype) && $setup.inputtype eq 'select'}checked{/if} title="下拉列表框">
        <input type="radio" name="setup[inputtype]" value="radio" {if isset($setup.inputtype) && $setup.inputtype eq 'radio'}checked{/if} title="单选框">
    </div>
</div>
<div class="layui-form-item">
    <label class="layui-form-label">字段类型</label>
    <div class="layui-input-inline">
        <select name="setup[fieldtype]"  onchange="javascript:numbertype(this.value);">
            <option value="varchar" {if isset($setup.fieldtype) && $setup.fieldtype eq 'varchar'}selected{/if} >字符 VARCHAR</option>
            <option value="tinyint" {if isset($setup.fieldtype) && $setup.fieldtype eq 'tinyint'}selected{/if}>整数 TINYINT(3)</option>
        </select>
        <span id="numbertype" style="display:none;"  >
                <input type="checkbox" name = "setup[numbertype]" value="1" {if isset($setup.numbertype) && $setup.numbertype eq 1}checked{/if}  title="不包括负数"/>
        </span>
    </div>
</div>
<div class="layui-form-item">
    <label class="layui-form-label">默认值</label>
    <div class="layui-input-inline">
        <input type="text" class="input-text layui-input" size="5"  name="setup[default]" value="{:isset($setup.default)?$setup.default:''}" />
    </div>
</div>
{/case}

{case value="typeid"}
<div class="layui-form-item">
    <label class="layui-form-label">选项类型</label>
    <div class="layui-input-inline">
        <input type="radio" name="setup[inputtype]" value="checkbox" {if isset($setup.inputtype) && $setup.inputtype == 'checkbox'}checked{/if} title="复选框">
        <input type="radio" name="setup[inputtype]" value="select" {if isset($setup.inputtype) && $setup.inputtype == 'select'}checked{/if} title="下拉列表框">
        <input type="radio" name="setup[inputtype]" value="radio" {if isset($setup.inputtype) && $setup.inputtype == 'radio'}checked{/if} title="单选框">
    </div>
</div>
<div class="layui-form-item">
    <label class="layui-form-label">字段类型</label>
    <div class="layui-input-inline">
        <select name="setup[fieldtype]"  onchange="javascript:numbertype(this.value);">
            <option value="varchar" {if isset($setup.fieldtype) && $setup.fieldtype == 'varchar'}selected{/if} >字符 VARCHAR</option>
            <option value="tinyint" {if isset($setup.fieldtype) && $setup.fieldtype == 'tinyint'}selected{/if} >整数 TINYINT(3)</option>
            <option value="smallint" {if isset($setup.fieldtype) && $setup.fieldtype == 'smallint'}selected{/if} >整数 SMALLINT(5)</option>
        </select>
        <span id="numbertype" style="display:none;"  >
            <input type="checkbox" name = "setup[numbertype]" value="1" {if isset($setup.numbertype) && $setup.numbertype eq 1}checked{/if} title="不包括负数"/>
        </span>
    </div>
</div>
<div class="layui-form-item">
    <label class="layui-form-label">顶级类别ID</label>
    <div class="layui-input-inline">
        <input type="text" class="input-text layui-input" size="5"  name="setup[default]" value="{:isset($setup.default)?$setup.default:''}" />
    </div>
</div>
{/case}

{case value="posid"}

{/case}
{case value="radio"}
<div class="layui-form-item">
    <label class="layui-form-label">选项列表</label>
    <div class="layui-col-lg4">
        <textarea name="setup[options]" class="layui-textarea">{:isset($setup.options)?$setup.options:''}</textarea>
    </div>
    <div class="layui-form-mid layui-word-aux">例：选项名称|值</div>
</div>
<div class="layui-form-item">
    <label class="layui-form-label">字段类型</label>
    <div class="layui-input-inline">
        <select name="setup[fieldtype]" onchange="javascript:numbertype(this.value);">
            <option value="varchar" {if isset($setup.fieldtype) && $setup.fieldtype == 'varchar'}selected{/if}>字符 VARCHAR</option>
            <option value="tinyint" {if isset($setup.fieldtype) && $setup.fieldtype == 'tinyint'}selected{/if}>整数 TINYINT(3)</option>
            <option value="smallint" {if isset($setup.fieldtype) && $setup.fieldtype == 'smallint'}selected{/if}>整数 SMALLINT(5)</option>
            <option value="mediumint" {if isset($setup.fieldtype) && $setup.fieldtype == 'mediumint'}selected{/if}>整数 MEDIUMINT(8)</option>
            <option value="int" {if isset($setup.fieldtype) && $setup.fieldtype == 'int'}selected{/if}>整数 INT(10)</option>
        </select>
        <span id="numbertype" style="display:none;"  >
            <input type="checkbox" name = "setup[numbertype]" value="1" {if isset($setup.numbertype) && $setup.numbertype == 1}checked{/if} title="不包括负数"/>
        </span>
    </div>
</div>
<div class="layui-form-item">
    <label class="layui-form-label">默认值</label>
    <div class="layui-input-inline">
        <input type="text" class="input-text layui-input" size="5"  name="setup[default]" value="{:isset($setup.default)?$setup.default:''}" />
    </div>
</div>
{/case}

{case value="checkbox"}
<div class="layui-form-item">
    <label class="layui-form-label">选项列表</label>
    <div class="layui-col-lg4">
        <textarea  name="setup[options]" class="layui-textarea">{:isset($setup.options)?$setup.options:''}</textarea>
    </div>
    <div class="layui-form-mid layui-word-aux">例：选项名称|值</div>
</div>
<div class="layui-form-item">
    <label class="layui-form-label">字段类型</label>
    <div class="layui-input-inline">
        <select name="setup[fieldtype]" onchange="javascript:numbertype(this.value);">
            <option value="varchar" {if isset($setup.fieldtype) && $setup.fieldtype == 'varchar'}selected{/if}>字符 VARCHAR</option>
            <option value="tinyint" {if isset($setup.fieldtype) && $setup.fieldtype == 'tinyint'}selected{/if}>整数 TINYINT(3)</option>
            <option value="smallint" {if isset($setup.fieldtype) && $setup.fieldtype == 'smallint'}selected{/if}>整数 SMALLINT(5)</option>
            <option value="mediumint" {if isset($setup.fieldtype) && $setup.fieldtype == 'mediumint'}selected{/if}>整数 MEDIUMINT(8)</option>
            <option value="int" {if isset($setup.fieldtype) && $setup.fieldtype == 'int'}selected{/if}>整数 INT(10)</option>
        </select>
        <span id="numbertype" style="display:none;"  >
            <input type="checkbox" name = "setup[numbertype]" value="1" checked title="不包括负数"/>
        </span>
    </div>
</div>
<div class="layui-form-item">
    <label class="layui-form-label">默认值</label>
    <div class="layui-input-inline">
        <input type="text" class="input-text layui-input" size="5"  name="setup[default]" value="{:isset($setup.default)?$setup.default:''}" />
    </div>
</div>
{/case}

{case value="number"}
<div class="layui-form-item">
    <label class="layui-form-label">是否包括负数</label>
    <div class="layui-input-inline">
        <input type="checkbox" name="setup[numbertype]" {if isset($setup.numbertype) && $setup.numbertype eq 1}checked{/if} value="1" title="不包括负数"/>
    </div>
</div>
<div class="layui-form-item">
    <label class="layui-form-label">小数位数</label>
    <div class="layui-input-inline">
        <select name="setup[decimaldigits]">
            <option {if isset($setup.decimaldigits) && $setup.decimaldigits eq 0}selected{/if} value="0">0</option>
            <option {if isset($setup.decimaldigits) && $setup.decimaldigits eq 1}selected{/if} value="1">1</option>
            <option {if isset($setup.decimaldigits) && $setup.decimaldigits eq 2}selected{/if} value="2">2</option>
            <option {if isset($setup.decimaldigits) && $setup.decimaldigits eq 3}selected{/if} value="3">3</option>
            <option {if isset($setup.decimaldigits) && $setup.decimaldigits eq 4}selected{/if} value="4">4</option>
            <option {if isset($setup.decimaldigits) && $setup.decimaldigits eq 5}selected{/if} value="5">5</option>
        </select>
    </div>
</div>
<div class="layui-form-item">
    <label class="layui-form-label">默认值</label>
    <div class="layui-input-inline">
        <input type="text" name="setup[default]" value="{:isset($setup.default)?$setup.default:''}" size="40" class="input-text layui-input">
    </div>
</div>
{/case}
{case value="tag"}
<div class="layui-form-item">
    <label class="layui-form-label">默认值</label>
    <div class="layui-input-inline">
        <input type="text" name="setup[default]" value="{:isset($setup.default)?$setup.default:''}" size="40" class="input-text layui-input">
    </div>
</div>
{/case}
{case value="image"}
<div class="layui-form-item">
    <label class="layui-form-label">图片类型</label>
    <div class="layui-input-inline">
        <input type="text" name="setup[upload_allowext]" value="{:isset($setup.upload_allowext)?$setup.upload_allowext:'jpg|jpeg|gif|png'}" class="input-text layui-input">
    </div>
</div>
{/case}

{case value="images"}
<div class="layui-form-item">

</div>
{/case}

{case value="file"}
<div class="layui-form-item">
    <label class="layui-form-label">文件类型</label>
    <div class="layui-input-inline">
        <input type="text" name="setup[upload_allowext]" value="{:isset($setup.upload_allowext)?$setup.upload_allowext:'zip|rar|doc|ppt'}" class="input-text layui-input">
    </div>
</div>
{/case}

{case value="files"}
<div class="layui-form-item">
</div>
{/case}
{default /}
{/switch}

<script>
    function numbertype(fieldtype){
        if(fieldtype=='varchar'){
            $('#numbertype').hide();
        }else{
            $('#numbertype').show();
        }
    }
</script>